/**************************************************************************************
 *  Copyright (c)  2010  Leszek Karcz.
 *  Permission is granted to copy, distribute and/or modify this document
 *  under the terms of the GNU Free Documentation License, Version 1.3
 *  or any later version published by the Free Software Foundation;
 *  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 *  A copy of the license is included in the section entitled "GNU
 *  Free Documentation License". 
 **************************************************************************************/
package main;
import data.StartScreenData;
import view.*;

/**************************************************************************************
 * Author(s): Leszek Karcz
 * Main class that initializes the game and all its data and components
 **************************************************************************************/
public class RunGame
{

	/**************************************************************************************
	 * Author(s): Leszek Karcz
	 * Main method
	 **************************************************************************************/
	public static void main(String[] args)
	{
		//initialize interpreter
		Interpreter interpreter=new Interpreter();
		
		//initialize key listener
		KeyDefinitions keyDefs = new KeyDefinitions();
		KeyDecoder KD = new KeyDecoder(interpreter,keyDefs);
		KeyboardListener KL = new KeyboardListener(KD);
		
		//Initialize mouse listener
		MouseClickListener MCL = new MouseClickListener(interpreter);
		
		//Initialize View
		View view = new View(KL,MCL);
		
		//link view to interpreter
		interpreter.addView(view);
		
		//initialize start StartScreenData
		StartScreenData startScreenData = new StartScreenData();
		
		//add start screen to the view
		view.addStartScreen(startScreenData);
		
		//link start screen to interpreter
		interpreter.addStartScreen(startScreenData);
		
		//Initialize Gameplay
		Gameplay gameplay=new Gameplay(view,interpreter);
		
		//gameplay.startGameplay();
	}
	
}
